#-*-encoding=utf-8-*-
steps = [
    FlowStep(
        name=u'687635',
        title=u'申请',
        fields=[u'title', u'start', u'end', u'applicant', u'description'],
        trigger=ur"""""",
        responsibles=u'[request.principal.id]',
    actions=[
        FlowStepAction(
            name=u'778765',
            title=u'提交申请',
            nextsteps=[u'801683'],
            finish_condition=u''
)
])
,

    FlowStep(
        name=u'801683',
        title=u'审核',
        fields=[u'start', u'end', u'reviewinfo'],
        trigger=ur"""ITagsManager(sheet).addTag('申请', True)


username = org_info.getPrincipalInfo(sheet["applicant"][0])['title']

msg_notifier.send(title='申请请假: ' + username,
              body=  sheet["title"] + '\n' + str(sheet["start"]) + ' - ' + str(sheet['end']),
              to_ids=task.responsibles,
              bound_obj=sheet)
""",
        responsibles=u'org_info.getUserManager(sheet["applicant"][0], flowsettings["reviewers"])',
    actions=[
        FlowStepAction(
            name=u'786479',
            title=u'申请通过',
            nextsteps=[u'174460'],
            trigger=ur"""ITagsManager(sheet).addTag('批准', True)

username = org_info.getPrincipalInfo(sheet['applicant'][0])['title']

msg_notifier.send(title='有人请假: ' + username,
              body=  sheet['title'] + '\n' + str(sheet['start']) + ' - ' + str(sheet['end']),
              to_ids=task.responsibles,
              bound_obj=sheet)
"""
),

        FlowStepAction(
            name=u'734618',
            title=u'拒绝',
            nextsteps=[],
            trigger=ur"""ITagsManager(sheet).addTag('拒绝', True)

msg_notifier.send(title='请假被拒: ' + sheet['title'],
              body='',
              to_ids=sheet['creators'],
              bound_obj=sheet)
"""
)
])
,

    FlowStep(
        name=u'174460',
        title=u'人事销假',
        fields=[],
        responsibles=u'flowsettings["hr"]',
    actions=[
        FlowStepAction(
            name=u'910916',
            title=u'请假结束，已经上班',
            nextsteps=[],
            trigger=ur"""ITagsManager(sheet).addTag('核销', True)

"""
)
])
]
